﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using BotvaBot.Configuration;
using BotvaBot.Configuration.Personaj;
using System.Windows.Input;
using BotvaBot.RichUI.Commands.MainForm;

namespace BotvaBot.RichUI
{
    public class BaseDataModel : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;


        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }

        #endregion
    }


    public class PersonajDTO : BaseDataModel
    {
        protected int m_Money = 0;
        public int Money
        {
            get { return m_Money; }
            set
            {
                m_Money = value;
                OnPropertyChanged("Money");
            }
        }


        protected int m_Kristaly = 0;
        public int Kristaly
        {
            get { return m_Kristaly; }

            set
            {
                m_Kristaly = value;
                OnPropertyChanged("Kristaly");
            }
        }



        protected int m_Pirashki = 0;
        public int Pirashki
        {
            get { return m_Pirashki; }
            set
            {
                m_Pirashki = value;
                OnPropertyChanged("Pirashki");
            }
        }


        protected int m_Kapusta = 0;
        public int Kapusta
        {
            get { return m_Kapusta; }
            set
            {
                m_Kapusta = value;
                OnPropertyChanged("Kapusta");
            }
        }

        protected int m_Kirka = 0;
        public int Kirka
        {
            get { return m_Kirka; }
            set
            {
                m_Kirka = value;
                OnPropertyChanged("Kirka");
            }
        }



        protected int m_Kaska = 0;
        public int Kaska
        {
            get { return m_Kaska; }
            set
            {
                m_Kaska = value;
                OnPropertyChanged("Kaska");
            }
        }



        protected int m_Ochki = 0;
        public int Ochki
        {
            get { return m_Ochki; }
            set
            {
                m_Ochki = value;
                OnPropertyChanged("Ochki");
            }
        }



        protected int m_ZdorovieMax = 0;
        public int ZdorovieMax
        {
            get { return m_ZdorovieMax; }
            set
            {
                m_ZdorovieMax = value;
                OnPropertyChanged("ZdorovieMax");
            }
        }


        protected int m_ZdorovieCurrent = 0;
        public int ZdorovieCurrent
        {
            get { return m_ZdorovieCurrent; }
            set
            {
                m_ZdorovieCurrent = value;
                OnPropertyChanged("ZdorovieCurrent");
            }
        }
    }



    public class ZverDTO : BaseDataModel
    {
        protected int m_ZdorovieMax = 0;
        public int ZdorovieMax
        {
            get { return m_ZdorovieMax; }
            set
            {
                m_ZdorovieMax = value;
                OnPropertyChanged("ZdorovieMax");
            }
        }


        protected int m_ZdorovieCurrent = 0;
        public int ZdorovieCurrent
        {
            get { return m_ZdorovieCurrent; }
            set
            {
                m_ZdorovieCurrent = value;
                OnPropertyChanged("ZdorovieCurrent");
            }
        }
    }


    public class MainPageDTO : BaseDataModel
    {
        public static MainPageDTO Value { get; set; }

        public MainPageDTO()
        {
            ShowCommandsWindow = new ShowCommandsWindowCommand();
        }

        protected PersonajDTO m_Personaj = null;
        public PersonajDTO Personaj
        {
            get { return m_Personaj; }
            set
            {
                m_Personaj = value;
                OnPropertyChanged("Personaj");
            }
        }


        protected int m_Zver = 0;
        public int Zver
        {
            get { return m_Zver; }
            set
            {
                m_Zver = value;
                OnPropertyChanged("Zver");
            }
        }


        public List<PersonajCfg> PersinajConfigs
        {
            get
            {
                return Config.Custom.PersonajSet.Items;
            }
        }

        #region Commands

        public ICommand ShowCommandsWindow { get; set; }

        #endregion Commands
    }
}
